#ifndef DATABASEEXPLORER_H
#define DATABASEEXPLORER_H

#include <QObject>
#include <QSqlDatabase>
#include <QTreeWidget>
#include <QTreeWidgetItem>

class DatabaseExplorer : public QObject
{
    Q_OBJECT

public:
    explicit DatabaseExplorer(QObject *parent = nullptr);
    ~DatabaseExplorer();

    void setDatabase(const QSqlDatabase &database);
    void refresh();

private:
    void loadDatabaseSchema();
    void loadTables(QTreeWidgetItem *parent);
    void loadViews(QTreeWidgetItem *parent);
    void loadProcedures(QTreeWidgetItem *parent);
    
    QSqlDatabase m_database;
    QTreeWidget *m_treeWidget;
};

#endif // DATABASEEXPLORER_H